package main

import (
	"fmt"
	"project01/com/oop/factory/model1"
)

/**
 * @author: guangcheng
 * @date:   2020/11/22 11:22
 * @version  V1.0
 * @description:
 *
 */
func main() {

	var stu model1.Student = model1.Student{
		Name: "tom",
		Age:  19,
	}
	fmt.Println(stu)

	//利用伪构造器产生实例变量
	person := model1.NewPerson("tomcat", 20)
	//0xc000006030 0xc0000044c0 {tomcat 20}
	fmt.Printf("%p %p %v\n", &person, person, *person)

	//访问私有字段的间谍法(戈塔特人 getter)
	getter := model1.NewPersonAllArgs("getter", 17, "女")
	fmt.Printf("%v %v %v\n", getter.GetSex(), getter.Age, getter.Name)

}
